package test.administrator.example.com.mvptest1.login;

/**
 * Created by thinkpad on 2018/7/17.
 */

import test.administrator.example.com.mvptest1.framework.support.base.MvpBasePresenter;
import test.administrator.example.com.mvptest1.utils.HttpUtils;

/**
 * 具体中介
 */
public class LoginPresenter extends MvpBasePresenter<LoginView<LoginModel>> {

	/**
	 * 持有同事引用
	 * 两个同事：M层、V层
	 */
	private LoginModel model;

	public LoginPresenter() {
		this.model = new LoginModel();
	}

	public void login(String username, String password) {
		this.model.login(username, password, new HttpUtils.OnHttpResultListener() {

			@Override
			public void onResult(Object result) {
//				if (getView() != null) {
				getView().onLoginResult(result);
//				}
			}
		});
	}

}






























































